import request from '@/utils/request'

export default {
    /**
     * 讲师列表（条件查询分页）
     * @param {当前页} current 
     * @param {每页记录数} size 
     * @param {条件对象} teacherQuery 
     * @returns 讲师分页列表
     */
    getTeacherListPage(current, size, teacherQuery) {
        return request({
            url: `/eduservice/teacher/pageTeacherCondition/${current}/${size}`,
            method: 'post',
            data: teacherQuery
          })
    },
    /**
     * 根据讲师id删除讲师信息
     * @param {讲师id} id 
     * @returns 
     */
    deleteTeacherById(id) {
        return request({
            url: `/eduservice/teacher/remove/${id}`,
            method: 'delete'
          })
    },
    /**
     * 添加讲师
     * @param {讲师对象} teacher 
     * @returns 
     */
    addTeacher(teacher) {
        return request({
            url: `/eduservice/teacher/addTeacher`,
            method: 'post',
            data: teacher
          })
    },
    /**
     * 根据讲师id查询讲师信息
     * @param {讲师id} id 
     * @returns 讲师对象
     */
    getTeacherById(id) {
        return request({
            url: `/eduservice/teacher/getTeacher/${id}`,
            method: 'get'
          })
    },
    /**
     * 
     * @param {讲师对象} teacher 
     * @returns 
     */
    updateTeacher(teacher) {
        return request({
            url: `/eduservice/teacher/updateTeacher`,
            method: 'post',
            data: teacher
          })
    }
}
